import { Component } from '@angular/core';
import {MatDialogActions, MatDialogClose, MatDialogContent, MatDialogTitle} from "@angular/material/dialog";
import {MatButton} from "@angular/material/button";
import {MatFormField, MatLabel} from "@angular/material/form-field";
import {MatInput} from "@angular/material/input";
import {FormBuilder, ReactiveFormsModule, Validators} from "@angular/forms";

@Component({
  selector: 'app-instance-create',
  standalone: true,
  imports: [
    MatDialogTitle,
    MatDialogContent,
    MatDialogActions,
    MatButton,
    MatDialogClose,
    MatFormField,
    MatInput,
    MatLabel,
    ReactiveFormsModule,
  ],
  templateUrl: './instance-create.component.html',
  styleUrl: './instance-create.component.scss'
})
export class InstanceCreateComponent {
  constructor(private fb: FormBuilder) {
  }
  instanceFB = this.fb.group({
    instance_name: ['', Validators.required],
    instance_describe: ['', Validators.required],
    address: ['', Validators.required],
    port: [0, Validators.required],
    username: ['', Validators.required],
    password: ['', Validators.required],
    cnf_file: ['/etc/my.cnf', Validators.required],
    data_dir: ['/var/lib/mysql', Validators.required],
  });
}
